<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
    <style type="text/css">
     html,body{background-color:#f5f6f4 ;background-size:100% 100%;  }
        .text-white {
            color: #f4f4f4 !important;
        }
        .aui-grid [class*=aui-col-] {
            padding: 0.75rem 0;
        }
        .iconfont{
          font-size: 1.5rem
        }
		#user_bg{
  position:fixed;
  top: 0;
  left: 0;
  width:100%;
  height:100%;
  min-width: 1000px;
  z-index:-10;
  zoom: 1;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-background-size: cover;
  -o-background-size: cover;
  background-position: center 0;
}
    </style>
</head>
<body>
    <!-- 顶部 -->



    <div class="aui-me-content-box"  onClick="toLogin()">
    			<div class="aui-me-content-info"></div>
    			<div class="aui-me-content-list">
    				<div class="aui-me-content-item">
    					<div class="aui-me-content-item-head">
    						<div class="aui-me-content-item-img">
    							<img src="" alt="" style="box-shadow: 0 2px 6px 0 rgba(0,0,0,0.3);">
    						</div>
    						<div id="islogin" class="aui-me-content-item-title"  onClick="toLogin()">CEO影院欢迎你！</div>

    					</div>
    					<div class="aui-me-content-item-text">

    						<a >
    							<span><img src="../image/jilu_logo/iqiyi.png" alt="" style="width: 20px; height: 20px; display: block; border: none; margin: 0 auto;"></span>
    							<span>爱奇艺</span>
    						</a>
    						<a>
    							<span><img src="../image/jilu_logo/tengxun.png" alt="" style="width: 20px; height: 20px; display: block; border: none; margin: 0 auto;"></span>
    							<span>腾讯</span>
    						</a>
    						<a>
    							<span><img src="../image/jilu_logo/youku.png" alt="" style="width: 20px; height: 20px; display: block; border: none; margin: 0 auto;"></span>
    							<span>优酷</span>
    						</a>
    						<a>
    							<span><img src="../image/jilu_logo/mgtv.png" alt="" style="width: 20px; height: 20px; display: block; border: none; margin: 0 auto;"></span>
    							<span>芒果</span>
    						</a>
    					</div>
    				</div>
    				<div class="aui-me-content-card">
    					<h3><i class="aui-icon aui-card-me" id="time_ico"></i> </h3>
    					<a  id="time"> - - - </a>
    				</div>
    			</div>
    		</div>

<!--    <section class="myui-bg-info" id="user-info">
      <div class="user-box">
        <div class="user-box-1" tapmode onClick="toLogin()">
          <img src="../image/user_img.png">
        </div>
          <div id="islogin" class="user-box-2" style="font-size:1rem;color:#00;" onClick="toLogin()">
              CEO影视
          </div>
          <div id="time" class="user-box-2" style="font-size:0.75rem;color:#000;" onClick="toLogin()">

          </div>

        </div>
    </section>
-->
    <div class="br"></div>
    <section class="aui-content" style="background-color: #fff;">
      <div class="br"></div>
      <div>
      <li style='width:25%;float: left;text-align: -webkit-center;border-right: 3px' onClick="openWin('open_vip_win')"><img src=../image/app/cz.png style='width: 30px;height: 30px;margin-top: 10px;' /><p style='color:#323232;margin-top: 10px;font-size: 12px;'>充值会员</p></li>
      <li style='width:25%;float: left;text-align: -webkit-center;border-right: 3px' onClick="openWin('share_win')"><img src=../image/app/jf.png style='width: 30px;height: 30px;margin-top: 10px;' /><p style='color:#323232;margin-top: 10px;font-size: 12px;'>获取积分</p></li>
      <li style='width:25%;float: left;text-align: -webkit-center;border-right: 3px' onClick="look_record()" ><img src=../image/app/jl.png style='width: 30px;height: 30px;margin-top: 10px;' /><p style='color:#323232;margin-top: 10px;font-size: 12px;'>观看记录</p></li>
	  <li style='width:25%;float: left;text-align: -webkit-center;border-right: 3px' onClick="openWin('daili')"><img src=../image/app/dl.png style='width: 30px;height: 30px;margin-top: 10px;' /><p style='color:#323232;margin-top: 10px;font-size: 12px;'>代理登录</p></li>
    <br /><br /><br />
    </div>
    <div class="br"></div>
  </section>
<div class="br"></div>
    <section class="aui-content">
        <ul class="aui-list aui-list-in" style="line-height:30px;">
          <li class="aui-list-item" onClick="openWin('jifen_win')" >
              <div class="aui-list-item-label-icon">
                  <i><img src="../image/app/duihuan.png" width="25" height="20"/></i>
              </div>
              <div class="aui-list-item-inner aui-list-item-arrow" >
                  <div style="font-size:0.75rem;color:#323232;">积分兑换</div>
                  <div id="jifen" class="aui-list-item-right"></div>
              </div>
          </li>

          <li class="aui-list-item" onClick="openWin('back_pwd')">
              <div class="aui-list-item-label-icon">
                  <i><img src="../image/app/mima.png" width="25" height="20"/></i>
              </div>
              <div class="aui-list-item-inner aui-list-item-arrow">
                  <div style="font-size:0.75rem;color:#323232;">修改密码</div>
                  <div  class="aui-list-item-right"></div>
              </div>
          </li>

<!--
          <li class="aui-list-item" tapmode onClick="openWin('shezhi_win')">
              <div class="aui-list-item-label-icon">
                  <i><img src="../image/app/shezhi.png" width="25" height="20"/></i>
              </div>
              <div class="aui-list-item-inner aui-list-item-arrow">
                  <div style="font-size:0.75rem;color:#323232;">其他设置</div>
                  <div class="aui-list-item-right"></div>
              </div>
          </li>

-->


  <!--        <li class="aui-list-item" tapmode onClick="openWin('shezhi_win')">
              <div class="aui-list-item-label-icon">
                  <i><img src="../image/app/tuiguang.png" width="25" height="20"/></i>
              </div>
              <div class="aui-list-item-inner aui-list-item-arrow">
                  <div style="font-size:0.75rem;color:#323232;">分享好友</div>
                  <div class="aui-list-item-right"></div>
              </div>
          </li>
-->
          <li class="aui-list-item" tapmode onClick="openWin('shezhi_win')">
              <div class="aui-list-item-label-icon">
                  <i><img src="../image/app/help.png" width="25" height="20"/></i>
              </div>
              <div class="aui-list-item-inner aui-list-item-arrow">
                  <div style="font-size:0.75rem;color:#323232;">观看帮助</div>
                  <div class="aui-list-item-right"></div>
              </div>
          </li>


                    <li class="aui-list-item" tapmode onClick="openWin('shezhi_win')">
                        <div class="aui-list-item-label-icon">
                            <i><img src="../image/app/help.png" width="25" height="20"/></i>
                        </div>
                        <div class="aui-list-item-inner aui-list-item-arrow">
                            <div style="font-size:0.75rem;color:#323232;">代理帮助</div>
                            <div class="aui-list-item-right"></div>
                        </div>
                    </li>

        </ul>

      </div>
    </section>


<div class="br"></div>
<section class="aui-content style="line-height:18px;"">
</div>

    <center><ul class="aui-list aui-list-in" style="line-height:30px;">


      <li class="aui-list-item" tapmode onClick="cleaCache()">
          <div class="aui-list-item-label-icon">
              <i><img src="../image/app/qingli.png" width="25" height="20"/></i>
          </div>
          <div class="aui-list-item-inner aui-list-item-arrow">
              <div style="font-size:0.75rem;color:#323232;">清理缓存</div>
              <div id="cache" class="aui-list-item-right"></div>
          </div>
      </li>

      <li class="aui-list-item" tapmode onClick="checkUpdate()">
          <div class="aui-list-item-label-icon">
              <i><img src="../image/app/shengji.png" width="25" height="20"/></i>
          </div>
          <div class="aui-list-item-inner aui-list-item-arrow">
              <div style="font-size:0.75rem;color:#323232;">检测更新</div>
              <div id="vsion" class="aui-list-item-right"></div>
          </div>
      </li>



                <li class="aui-list-item">
                    <div class="aui-list-item-label-icon" >
                        <i><img src="../image/app/kefu.png" width="25" height="20"/></i>
                    </div>
                    <div class="aui-list-item-inner aui-list-item-arrow">
                        <div style="font-size:0.75rem;color:#323232;">联系客服</div>
                        <div class="aui-list-item-right" class="user-bt" onClick="api.alert({title: '免责声明',msg: '本站所有视频均来自互联网，版权归原创者所有，如果侵犯了您的权益，请通知我们，我们将会在3个正常工作日内删除其侵权内容，谢谢合作。',  });"> CEO影视  <span style="color:#7bbfea">免责声明</span> </div>
                    </div>
                </li>




    </ul>

    <div id="otbtn" class="aui-content-padded" tapmode onclick="exitLogin()">
        <div class="aui-btn-tuichu aui-btn-block">退出</div>
    </div>

</section>

<div class="br"></div>


</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript">
    var api_url = localStorage.getItem('api_url');

    apiready = function () {

  //下拉刷新
      api.setCustomRefreshHeaderInfo({
          bgColor : '#f0f0f0',
      }, function() {
          //下拉刷新被触发，自动进入加载状态，使用 api.refreshHeaderLoadDone() 手动结束加载中状态
          setTimeout(function(){
      api.refreshHeaderLoadDone()
          }, 3000);
      });
      //下拉刷新


      api.parseTapmode();
      var appVersion = api.appVersion;
      var vsion = $api.byId('vsion');
      vsion.innerHTML = 'v'+appVersion;

      api.parseTapmode();
      //计算缓存
      getCache();

      //监听重新获取客服联系方式广播
      api.addEventListener({
          name: 'newLoingdata'
      }, function(ret, err) {
        if (ret) {
          getData();
          location.reload();
        }
      });

      getData();

    }


    //联系客服按钮
    function kefu(){
      if (localStorage.getItem('user_id')<1) {
        api.alert({
            title: '请先登录',
            msg: '知道了',
        });
      }else {
        var dialogBox = api.require('dialogBox');
        dialogBox.alert({
            texts: {
                content: localStorage.getItem('url')+localStorage.getItem('user_weichat'),
                leftBtnTitle: '知道了',
                rightBtnTitle: '复制'
            },
            styles: {
                bg: '#fff',
                w: 300,
                content: {
                    color: '#000',
                    size: 14
                },
                left: {
                    marginB: 7,
                    marginL: 20,
                    w: 130,
                    h: 35,
                    corner: 2,
                    bg: '#ff7600',
                    color: '#fff',
                    size: 14
                },
                right: {
                    marginB: 7,
                    marginL: 10,
                    w: 130,
                    h: 35,
                    corner: 2,
                    bg: '#ff7600',
                    color: '#fff',
                    size: 14
                }
            }
        }, function(ret) {
            if (ret.eventType == 'left') {
                var dialogBox = api.require('dialogBox');
                dialogBox.close({
                    dialogName: 'alert'
                });
            }else if (ret.eventType == 'right') {
              var clipBoard = api.require('clipBoard');
              clipBoard.set({
                  value: localStorage.getItem('user_weichat')
              }, function(ret, err) {
                  if (ret) {
                    api.toast({
                        msg: '已复制号码到剪切板',
                        duration: 2000
                    });
                    var dialogBox = api.require('dialogBox');
                    dialogBox.close({
                        dialogName: 'alert'
                    });
                  } else {

                  }
              });
            }
        });
      }
    }


    function openWin(name){
      if (localStorage.getItem('user_id')<1) {
        api.openWin({
            name: 'login',
            url: './login.html',
        });
        return;
      }else {
        var delay = 0;
        if(api.systemType != 'ios'){
            delay = 300;
        }

        api.openWin({
            name: ''+name+'',
            url: ''+name+'.html',
            bounces:false,
            delay: delay,
            slidBackEnabled:true,
            vScrollBarEnabled:false
        });
      }

    }
    //获取数据
    function getData(){
      var user_id = localStorage.getItem('user_id');
      var user_name = localStorage.getItem('user_name');
      var user_time = localStorage.getItem('user_time');
      var s1 = formatDateTime(user_time);
      var timestamp = Date.parse(new Date())/1000;
      var time = $api.byId('time');
      var islogin = $api.byId('islogin');
      //alert(user_time);
      if (user_time>timestamp) {
      time_ico.innerHTML = '<i class="iconfont icon-huiyuan" style="font-size:0.7rem;color:#ff5722"></i> 全网通视频 VIP';
        time.innerHTML = ' 将于 '+s1+' 到期';
      }
      if (user_time<timestamp) {
      time_ico.innerHTML = '<i class="iconfont icon-huiyuan" style="font-size:0.7rem;color:#ff5722"></i> 已过期';
        time.innerHTML = 'VIP已到期 请及时续费';
      }
      if(user_time == "-1") {
      time_ico.innerHTML = '<i class="iconfont icon-huiyuan" style="font-size:0.7rem;color:#ff5722"></i> 全网通视频永久 VIP ';
        time.innerHTML = ' 感谢支持！';
      }
      if (localStorage.getItem('user_id')<1) {
        time_ico.innerHTML = '<i class="iconfont icon-huiyuan" style="font-size:0.7rem;color:#ff5722"></i> - - - ';
        time.innerHTML = '请先登陆';
      }
      if (localStorage.getItem('user_name')>1) {
        islogin.innerHTML = '账号：'+user_name;
      }

    }


//未登录提示
var timer = setInterval(function(){
    doItPerSecond();
},20000)

function doItPerSecond() {


  if (localStorage.getItem('user_id')<1) {

    api.toast({
        msg: '还没登陆 部分功能受限',
        duration: 5000
    });

  }


}



    function formatDateTime(timeStamp) {
        var date = new Date();
        date.setTime(timeStamp * 1000);
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? ('0' + m) : m;
        var d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        var h = date.getHours();
        h = h < 10 ? ('0' + h) : h;
        var minute = date.getMinutes();
        var second = date.getSeconds();
        minute = minute < 10 ? ('0' + minute) : minute;
        second = second < 10 ? ('0' + second) : second;
        return y + '-' + m + '-' + d;
    };


    function toLogin(){

//判断   如果user_id大于0 （已登录） 并且 VIP时间为永久时  弹出提示
            if(localStorage.getItem('user_id')>0  && localStorage.getItem('user_time') == "-1"  ) {

                        api.toast({
                  msg: '永久VIP  无需升级 感谢支持！',
                  duration: 2000
              });

            }else{


//判断   如果user_id大于0 （已登录） 并且 VIP时间不等于永久时  跳转升级
      if (localStorage.getItem('user_id')>0  && localStorage.getItem('user_time') !== "-1") {
          api.openWin({
              name: 'open_vip_win',
              url: './open_vip_win.html',
              delay: 300,
          });

          //判断   如果user_id小于0 （未登录） 跳转登录
      }else {
        api.openWin({
            name: 'login',
            url: './login.html',
            delay: 300,
        });
      }

    }


    }




// 如果已经登录 就跳转到VIP升级
/*
    function toVip(){

        if (user_id>0 ) {
          api.openWin({
              name: 'open_vip_win',
              url: './open_vip_win.html',
              delay: 300,
          });
        }else {     //否则跳转到登录
          api.openWin({
              name: 'login',
              url: './login.html',
              delay: 300,
          });

        }

    }

*/


    //退出登录
    function exitLogin(){
      api.sendEvent({
        name: 'newLoingdata',
        extra: {
        }
      });
  /*
     api.showProgress({
          title: '稍后...',
          text: '正在退出...',
          modal: false
      });
      */
      localStorage.setItem('user_id','');
      localStorage.setItem('user_name','');
      localStorage.setItem('user_time','');
      api.toast({
          msg: ' 已安全退出',
          duration: 2000
      });
      api.openWin({
      });

    }



//打开页面
      function openWin(name){

//如果判断没有登录 就提示  并跳转到登录页面
        if (localStorage.getItem('user_id')<1) {

          api.toast({
    msg: '(ｷ｀ﾟДﾟ´)!!    你还没登陆！',
    duration: 2000
});


           api.openWin({
               name: 'login',
               url: './login.html',
               delay: 2000
           });
           return;
         }
//↑↑↑↑↑↑↑上面LEEi   新加

            var delay = 0;
            if(api.systemType != 'ios'){
                delay = 300;
            }
            api.openWin({
                name: ''+name+'',
                url: ''+name+'.html',
                bounces:false,
                delay: delay,
                slidBackEnabled:true,
                vScrollBarEnabled:false
            });
        }

//清楚缓存
function cleaCache(){
  api.clearCache(function() {
      api.toast({
          msg: '清除完成'
      });
      getCache();
  });
}
//计算缓存
function getCache(){
  api.getCacheSize(function(ret) {
      var size = ret.size/1024/1024;
      var mb = size.toFixed(2)
      var cache = $api.byId('cache');
      cache.innerHTML = mb+'MB';

  });
}






  //更新app  （在apicloud进行）

  function checkUpdate() {
var mam = api.require('mam');
mam.checkUpdate(function(ret, err) {
if (ret) {
  var result = ret.result;
  if (result.update == true && result.closed == false) {
    //  var str = '新版本号:' + result.version + '\n更新内容:' + result.updateTip  //下载地址:' + ';发布时间:' + result.time; + result.source + '; 需要的可以加上去
     var str = '发布时间:' + result.time + '\n更新内容:\n' + result.updateTip   //下载地址:' + ';发布时间:' + result.time; + result.source + '; 需要的可以加上去
      api.confirm({
          title : '已有新版本 V' + result.version,
          msg : str,
          buttons : ['更新', '取消']
      }, function(ret, err) {
          if (ret.buttonIndex == 1) {
              if (api.systemType == "android") {
                  api.download({
                      url : result.source,
                      report : true
                  }, function(ret, err) {
                      if (ret && 0 == ret.state) {/* 下载进度 */
                          api.toast({
                              msg : "正在更新应用" + ret.percent + "%",
                              duration : 2000
                          });
                      }
                      if (ret && 1 == ret.state) {/* 下载完成 */
                          var savePath = ret.savePath;
                          api.installApp({
                              appUri : savePath
                          });
                      }
                  });
              }
              if (api.systemType == "ios") {
                  api.installApp({
                      appUri : result.source
                  });
              }
          }
      });
  } else {
    /*
      api.alert({
          msg : "已是最新版，无需更新！"
      });
      */
      api.toast({
          msg : "(o゜▽゜)o☆[BINGO!] 你现在用的是最新版本！",
          duration : 5000
      });
  }
} else {
  api.alert({
      msg : err.msg
  });
}
});
}
  function look_record(){
	api.openWin({
	    name: 'look_record',
	    url: 'look_record.html'
    });
}

</script>




<script type="text/javascript">
//下拉刷新
    function fnRefreshHeaderLoading() {
        api.refreshHeaderLoading();
    };
</script>






</html>
